package com.webcamtracker.image.color.gevers;

import com.webcamtracker.image.Color;

public class GeversColor implements Color {

    private double c1;
    private double c2;
    private double c3;

    public GeversColor(double c1, double c2, double c3) {
        this.c1 = c1;
        this.c3 = c3;
        this.c2 = c2;
    }

    public double getC1() {
        return c1;
    }

    public void setC1(double c1) {
        this.c1 = c1;
    }

    public double getC3() {
        return c3;
    }

    public void setC3(double c3) {
        this.c3 = c3;
    }

    public double getC2() {
        return c2;
    }

    public void setC2(double c2) {
        this.c2 = c2;
    }


    public String toString() {
        return "GeversColor{" +
                "c1=" + c1 +
                ", c2=" + c2 +
                ", c3=" + c3 +
                '}';
    }

    public boolean isSimilar(Color searchColor, double threadsHold) {
        final GeversColor geversColor = (GeversColor) searchColor;
        return geversColor.getC1() == getC1() &&
                geversColor.getC2() == getC2() &&
                geversColor.getC3() == getC3();
    }

    public double[] elements() {
        return new double[]{getC1(), getC2(), getC3()};
    }

}
